package code15Lambda表达式;

import java.util.Arrays;
import java.util.List;
import java.util.function.Function;

/**
 * @author 黄衡熙
 * @version 1.0
 */
public class Test05_函数型接口 {

    public static void main(String[] args) {
        List<Integer> list = Arrays.asList(1, 2, 3, 5, 6, 7, 9, 12);
        Integer size = testFunction(l -> l.size(), list);
        System.out.println("集合长度为:" + size);
    }

    public static Integer testFunction(Function<List<Integer>, Integer> function, List<Integer> list) {
        return function.apply(list);
    }

}